/*******************************************************************************
 * Copyright (c) 2012 Philip Douglas.
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 ******************************************************************************/
package net.pdouglas.revisiondroid;

import android.view.View;

public class OnClickListener implements android.view.View.OnClickListener {
    RevisionDroid mFrontEnd;

    /**
     * Constructs a new instance.
     */
    public OnClickListener(RevisionDroid frontEndRef) {
        mFrontEnd = frontEndRef;
    }

    public void onClick(View v) {
    	mFrontEnd.startMyService();
        switch (v.getId()) {
	        case R.id.revise_button:
	        case R.id.revise_counter:
	        case R.id.revise_bar:
	            mFrontEnd.reviseButton();
	            return;
	        case R.id.break_button:
	        case R.id.break_counter:
	        case R.id.break_bar:
	            mFrontEnd.relaxButton();
	            return;
	        case R.id.pause_button:
	            mFrontEnd.pauseButton();
	            return;
        }
    }
}
